home *** CD-ROM | disk | FTP | other *** search
/ Euroscene 2 / Euroscene 2.iso / USEFUL / DeliTracker130 / Developer / Developer.run / Examples / Music-Ass.s < prev    next >
Encoding:
Text File  |  1992-09-23  |  3.4 KB  |  182 lines

  1.  
  2.     incdir    "Includes:"
  3.     include "misc/DeliPlayer.i"
  4.  
  5. ;
  6. ;
  7.     SECTION Player,Code
  8. ;
  9. ;
  10.  
  11.     PLAYERHEADER PlayerTagArray
  12.  
  13.     dc.b '$VER: Music-Assembler player module V1.1 (12 Sep 92)',0
  14.     even
  15.  
  16. PlayerTagArray
  17.     dc.l    DTP_PlayerVersion,1
  18.     dc.l    DTP_PlayerName,PName
  19.     dc.l    DTP_Creator,CName
  20.     dc.l    DTP_Check2,Chk
  21.     dc.l    DTP_Interrupt,Int
  22.     dc.l    DTP_SubSongRange,SubSong
  23.     dc.l    DTP_InitPlayer,InitPlay
  24.     dc.l    DTP_EndPlayer,EndPlay
  25.     dc.l    DTP_InitSound,InitSnd
  26.     dc.l    DTP_EndSound,RemSnd
  27.     dc.l    DTP_Volume,Volume
  28.     dc.l    DTP_PrevSong,PrevSub
  29.     dc.l    DTP_NextSong,NextSub
  30.     dc.l    TAG_DONE
  31.  
  32. *-----------------------------------------------------------------------*
  33. ;
  34. ; Player/Creatorname und lokale Daten
  35.  
  36. PName    dc.b 'Music-Assembler',0
  37. CName    dc.b 'Oscar Giesen and Marco Swagerman,',10
  38.     dc.b 'adapted by Delirium',0
  39.     even
  40. ma_data        dc.l 0
  41.  
  42. *-----------------------------------------------------------------------*
  43. ;
  44. ;Interrupt für Replay
  45.  
  46. Int
  47.     movem.l    d0-d7/a0-a6,-(sp)
  48.     move.l    ma_data(pc),a0            ; Base
  49.     jsr    $c(a0)                ; DudelDiDum
  50.     movem.l    (sp)+,d0-d7/a0-a6
  51.     rts
  52.  
  53. *-----------------------------------------------------------------------*
  54. ;
  55. ; Testet, ob es sich um ein Music-Assembler-Modul handelt
  56.  
  57. Chk
  58.     move.l    dtg_ChkData(a5),a0
  59.  
  60.     moveq    #-1,d0                ; Modul nicht erkannt (default)
  61.  
  62.     cmpi.w    #$6000,$0(a0)            ; bra - Instruction
  63.     bne.s    ChkEnd
  64.     cmpi.w    #$6000,$4(a0)            ; bra - Instruction
  65.     bne.s    ChkEnd
  66.     cmpi.w    #$6000,$8(a0)            ; bra - Instruction
  67.     bne.s    ChkEnd
  68.     cmpi.w    #$48e7,$c(a0)            ; movem - Instruction
  69.     bne.s    ChkEnd
  70.  
  71.     moveq    #0,d0                ; Modul erkannt
  72. ChkEnd
  73.     rts
  74.  
  75. *-----------------------------------------------------------------------*
  76. ;
  77. ; Set min. & max. subsong number
  78.  
  79. SubSong
  80.     moveq    #0,d0                ; min.
  81.     moveq    #9,d1                ; max.
  82.     rts
  83.  
  84. *-----------------------------------------------------------------------*
  85. ;
  86. ; Init Player
  87.  
  88. InitPlay
  89.     moveq    #0,d0
  90.     move.l    dtg_GetListData(a5),a0        ; Function
  91.     jsr    (a0)
  92.     move.l    a0,ma_data
  93.  
  94.     move.l    dtg_AudioAlloc(a5),a0        ; Function
  95.     jsr    (a0)                ; returncode is already set !
  96.     rts
  97.  
  98. *-----------------------------------------------------------------------*
  99. ;
  100. ; End Player
  101.  
  102. EndPlay
  103.     move.l    dtg_AudioFree(a5),a0        ; Function
  104.     jsr    (a0)
  105.     rts
  106.  
  107. *-----------------------------------------------------------------------*
  108. ;
  109. ; Init Sound
  110.  
  111. InitSnd
  112.     move.w    dtg_SndNum(a5),d0
  113.     move.l    ma_data(pc),a0
  114.     jsr    (a0)                ; Init Sound
  115.  
  116.     bsr    Volume                ; set Volume
  117.     rts
  118.  
  119. *-----------------------------------------------------------------------*
  120. ;
  121. ; Remove Sound
  122.  
  123. RemSnd
  124.     lea    $dff000,a0
  125.     moveq    #0,d0
  126.     move.w    d0,$a8(a0)
  127.     move.w    d0,$b8(a0)
  128.     move.w    d0,$c8(a0)
  129.     move.w    d0,$d8(a0)
  130.     move.w    #$000F,$96(a0)            ; End Sound
  131.     rts
  132.  
  133. *-----------------------------------------------------------------------*
  134. ;
  135. ; Previous SubSong
  136.  
  137. PrevSub
  138.     tst.w    dtg_SndNum(a5)            ; min Subsong ?
  139.     beq.s    PrevSubEnd
  140.  
  141.     move.l    dtg_StopInt(a5),a0
  142.     jsr    (a0)
  143.     bsr    RemSnd
  144.     subq.w    #1,dtg_SndNum(a5)        ; Vorheriger Sound
  145.     bsr    InitSnd
  146.     move.l    dtg_StartInt(a5),a0
  147.     jsr    (a0)
  148. PrevSubEnd
  149.     rts
  150.  
  151. *-----------------------------------------------------------------------*
  152. ;
  153. ; Next SubSong
  154.  
  155. NextSub
  156.     cmpi.w    #9,dtg_SndNum(a5)        ; max Subsong ?
  157.     beq.s    PrevSubEnd
  158.  
  159.     move.l    dtg_StopInt(a5),a0
  160.     jsr    (a0)
  161.     bsr    RemSnd
  162.     addq.w    #1,dtg_SndNum(a5)        ; Nächster Sound
  163.     bsr    InitSnd
  164.     move.l    dtg_StartInt(a5),a0
  165.     jsr    (a0)
  166. NextSubEnd
  167.     rts
  168.  
  169. *-----------------------------------------------------------------------*
  170. ;
  171. ; Change Volume
  172.  
  173. Volume
  174.     move.w    dtg_SndVol(a5),d0
  175.     moveq    #15,d1
  176.     move.l    ma_data(pc),a0
  177.     jsr    $8(a0)                ; New Volume
  178.     rts
  179.  
  180. *-----------------------------------------------------------------------*
  181.  
  182.